package org.xbill.DNS;

import java.io.IOException;

public class NSECRecord extends Record
{
  private static final long serialVersionUID = -2010302633L;
  private Name next;
  private TypeBitmap types;

  public NSECRecord(Name paramName1, int paramInt, long paramLong, Name paramName2, int[] paramArrayOfInt)
  {
    super(paramName1, 47, paramInt, paramLong);
    this.next = checkName("next", paramName2);
    int i = 0;
    while (true)
    {
      if (i >= paramArrayOfInt.length)
      {
        this.types = new TypeBitmap(paramArrayOfInt);
        return;
      }
      Type.check(paramArrayOfInt[i]);
      ++i;
    }
  }

  public Name getNext()
  {
    return this.next;
  }

  Record getObject()
  {
    return new NSECRecord();
  }

  public int[] getTypes()
  {
    return this.types.toArray();
  }

  public boolean hasType(int paramInt)
  {
    return this.types.contains(paramInt);
  }

  void rdataFromString(Tokenizer paramTokenizer, Name paramName)
    throws IOException
  {
    this.next = paramTokenizer.getName(paramName);
    this.types = new TypeBitmap(paramTokenizer);
  }

  void rrFromWire(DNSInput paramDNSInput)
    throws IOException
  {
    this.next = new Name(paramDNSInput);
    this.types = new TypeBitmap(paramDNSInput);
  }

  String rrToString()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append(this.next);
    if (!(this.types.empty()))
    {
      localStringBuffer.append(' ');
      localStringBuffer.append(this.types.toString());
    }
    return localStringBuffer.toString();
  }

  void rrToWire(DNSOutput paramDNSOutput, Compression paramCompression, boolean paramBoolean)
  {
    this.next.toWire(paramDNSOutput, null, false);
    this.types.toWire(paramDNSOutput);
  }
}